fix: use output.assetPrefix in none mode#5352
Merged
chenjiahan merged 2 commits intomainfrom Jun 3, 2025
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates both documentation and code to ensure that output.assetPrefix is applied in production and none modes by switching the logic from an isProd check to an isDev check.
- Updated docs in both Chinese and English to reflect the supported modes.
- Changed the public path logic in packages/core/src/plugins/output.ts to use the isDev flag.
- Added a new end-to-end test to validate output.assetPrefix behavior in none mode.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/config/output/asset-prefix.mdx | Updated mode description to clarify production and none modes usage. |
| website/docs/zh/config/mode.mdx | Updated to reference correct assetPrefix options for each mode. |
| website/docs/zh/config/dev/asset-prefix.mdx | Modified to reflect updated mode clarifications. |
| website/docs/en/config/output/asset-prefix.mdx | Updated mode description and code examples in TypeScript. |
| website/docs/en/config/mode.mdx | Updated to reference correct assetPrefix options for each mode. |
| website/docs/en/config/dev/asset-prefix.mdx | Modified to reflect updated mode clarifications using TypeScript. |
| packages/core/src/plugins/output.ts | Changed public path logic from using isProd to isDev. |
| e2e/cases/assets/asset-prefix/index.test.ts | Added test verifying that output.assetPrefix is used in none mode. |
Comments suppressed due to low confidence (1)
packages/core/src/plugins/output.ts:30
- [nitpick] The parameter 'isDev' is used to decide whether to use output.assetPrefix by negating it. Consider renaming it (or adding a clarifying comment) to better reflect that the condition applies to both production and none modes.
if (!isDev) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Updated
getPublicPathto useisDevinstead ofisProdfor determining the asset prefix, ensuringoutput.assetPrefixis used inproductionandnonemodes.Based on the semantics and usage of the existing configuration,
output.assetPrefixis conceptually closer to configuring the asset path ofnonemode. This means that if users build innonemode, they should be able to useoutput.assetPrefixto specify the asset prefix.Related Links
assetPrefixfails when using an.envfile to customizeNODE_ENV#5351Checklist